package com.leoandroid.tool.toolsbox

import android.os.Bundle
import android.webkit.WebResourceRequest
import android.webkit.WebView
import android.webkit.WebViewClient
import androidx.appcompat.app.AppCompatActivity
import com.leoandroid.tool.toolsbox.largeread.databinding.ActivityColorListBinding

class ColorListActivity:AppCompatActivity() {

    var bindingF: ActivityColorListBinding?=null
    val binding get() = bindingF!!

    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        bindingF = ActivityColorListBinding.inflate(layoutInflater)
        setContentView(binding.root)
        binding.includeTitle.titleTv.text = "色值大全"
        binding.includeTitle.backIv.setOnClickListener {
            finish()
        }
        val myWebViewClient = MyWebViewClient()
        binding.webview.webViewClient = myWebViewClient
        binding.webview.loadUrl("https://likexia.gitee.io/tools/colors/index.html")
    }

    //内部跳转
    class MyWebViewClient: WebViewClient() {
        override fun shouldOverrideUrlLoading(
            view: WebView?,
            request: WebResourceRequest?
        ): Boolean {
            return false
        }
    }
}